package ijij41.togetherTrain;

import ijij41.chat.*;
import ijij41.togetherTrain.common.AbstractSearchTrainActivity;
import ijij41.togetherTrain.config.TrainConfig;
import ijij41.togetherTrain.participate.*;
import ijij41.togetherTrain.personal.MyTicketListActivity;
import ijij41.togetherTrain.recruit.TrainListRecruitActivity;
import ijij41.togetherTrain.recruit.SearchTrainRecruitActivity;
import android.app.Activity;
import android.content.*;
import android.os.Bundle;
import android.view.*;
import android.widget.*;

public class MainActivity extends Activity implements TrainConfig {
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);

		initComponent();

	}

	private void initComponent() {
		
		findViewById(R.id.btn_participate_ticket).setOnClickListener(mClickListener);
		findViewById(R.id.btn_create_ticket).setOnClickListener(mClickListener);
		findViewById(R.id.btn_showup_ticket).setOnClickListener(mClickListener);
		//findViewById(R.id.btn_test_chat).setOnClickListener(mClickListener);

		((TextView) findViewById(R.id.tv_user_id)).setText(TrainConfig.user_id);
	}
	
	

	private Button.OnClickListener mClickListener = new Button.OnClickListener() {
		@Override
		public void onClick(View v) {
			switch (v.getId()) {
			
			case R.id.btn_participate_ticket:
				Intent searchActivity = new Intent(MainActivity.this,
						SearchTrainParticipateActivity.class);
				startActivity(searchActivity);
				break;

			case R.id.btn_create_ticket:
				
				Intent test = new Intent(MainActivity.this,
						SearchTrainRecruitActivity.class);
				startActivity(test);
				
				break;
				
				
			case R.id.btn_showup_ticket:
				Intent myTicketActivity = new Intent(MainActivity.this,
						MyTicketListActivity.class);
				startActivity(myTicketActivity);
				break;
				
				
/**
			case R.id.btn_test_chat:
				
//				Intent chatActivity = new Intent(MainActivity.this,
//						ChatActivity.class);
//				startActivity(chatActivity);
				
				Intent MultiChatActivity = new Intent(MainActivity.this,
						MultiChatActivity.class);
				startActivity(MultiChatActivity);
				
				break;
				**/

			default:
				break;
			}

		}

	};
}

// TODO [해야 할일 목록]
// 1. 신규 생성 방 (날짜, 열차번호, 구간 , 만드는 사용자, 모집인원)
// 2. 만들어진 방조회
// 3. 방조회시 사용자 나오기 (기타여러가지 기능에 대해서 고민)
// 4. ready에 관한 시나리오 작성 , 완료 시나리오
// 5. 조회 , 삽입 쿼리에 대해서 고민 필요

